package com.nvshen.zhangmeiying.profile;

import android.os.Bundle;
import com.nvshen.zhangmeiying.BaseActivity;
import com.nvshen.zhangmeiying.R;

/**
 * Created by lixinbo on 14-10-8.
 */
public class ProfileActivity extends BaseActivity
{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_profile);
    }

//    CircleImageView avatar;
//    TextView nameView,locationView,descriptionView,idView,xqahView,homeView,musicView,bookView,dreamView;
//
//    User curUid;
//    UserDetail curUser;
//
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_profile);
//
//        curUid = (User) getIntent().getSerializableExtra("extra_user");
//
//        if(curUid == null){
//            Toast.makeText(this, "获取用户失败", Toast.LENGTH_SHORT).show();
//            getParent().finish();
//        }
//
//        initViews();
//        resetData();
//    }
//
//    private void initViews() {
//        avatar = (CircleImageView) findViewById(R.id.pDetail_avatar);
//        nameView = (TextView) findViewById(R.id.pDetail_name);
//        locationView = (TextView) findViewById(R.id.pDetail_location);
//        descriptionView = (TextView) findViewById(R.id.pDetail_description);
//        idView = (TextView) findViewById(R.id.pDetail_id_show);
//        xqahView = (TextView) findViewById(R.id.pDetail_xqah_show);
//        homeView = (TextView) findViewById(R.id.pDetail_home_show);
//        musicView = (TextView) findViewById(R.id.pDetail_music_show);
//        bookView = (TextView) findViewById(R.id.pDetail_book_show);
//        dreamView = (TextView) findViewById(R.id.pDetail_dream_show);
//
//        findViewById(R.id.head_left).setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                getParent().finish();
//            }
//        });
//    }
//
//    private void resetData() {
//        NetDialogUtils.showProgressDialog(this,"获取个人资料中....");
//        NetUtils.get(UrlUtils.getProfileUrl(curUid.getId()),new PerfectAsyncHandler() {
//            @Override
//            public void onGetSuccess(Header[] header, String result) {
//                Logger.d("result", result);
//
//                curUser = new Gson().fromJson(result,UserDetail.class);
//                Constants.currentObserverUser = curUser;
//                refreshViews();
//            }
//
//            @Override
//            public void onGetFailure(String errorCause) {
//
//            }
//        });
//    }
//
//    private void refreshViews() {
//        if(!TextUtils.isEmpty(curUser.getAvatar())){
//            DisplayImageOptions options = new DisplayImageOptions.Builder().showStubImage(R.drawable.avatar_loading).cacheOnDisc().cacheInMemory().build();
//            ImageLoader.getInstance().displayImage(curUser.getAvatar(), avatar, options);
//        }
//
//        nameView.setText(curUser.getNickname());
//        locationView.setText(curUser.getHome_province()+" "+curUser.getHome_city());
//        descriptionView.setText(curUser.getWord());
//
//        idView.setText(curUser.getId()+"");
//        xqahView.setText(curUser.getHobby());
//        homeView.setText(curUser.getHome_province()+" "+curUser.getHome_city());
//
//        musicView.setText(curUser.getMusic());
//        bookView.setText(curUser.getBook());
//        dreamView.setText(curUser.getDream());
//    }


}